home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
utility
/
repeat20.zip
/
REPEAT.DOC
next >
Wrap
Text File
|
1994-01-14
|
4KB
|
93 lines
REPEAT v2.0
(c) 1991 by Ben Bernard
The original idea of REPEAT was to allow you to apply a single command to
multiple files. This is needed for such commands as TYPE, which doesn't
accept wildcards. The solution was REPEAT TYPE # FOR *.TXT. In using v 1.0
I found many other things which I thought should be added. You can see
the result below. Macro substitutions allow REPEAT to perform complex
decisions based on variables related to the files being processed.
REPEAT is really a prototype, written with MS BASIC PDS 7.1, of a future
program to be implemented in C when I get time to do so. In the meantime,
if I have left what you deem to be a useful feature out of REPEAT, drop me
a line at the adresses listed at the end.
Legal stuff: You use this program AT YOUR OWN RISK. By using REPEAT, you
agree to absolve me of all claims for damage to any hardware, software, or
data which might be caused by this program. You are hereby granted license to
use REPEAT for any use and any period of time, provided you do not modify the
code in any way. This software may be distributed only in its original and
complete package, either in the original ZIP file or in an equivalent archive.
No fee can be charged for this software. Disk duplicators and BBSs may,
however, charge a fee for their services.
Usage: REPEAT {command} FOR {filespec} IF {mask}
{command} will be executed once for each file in {filespec} for which
{mask} evaluates to true.
{command} can contain any DOS command, plus the macros listed below.
{filespec} can have full pathname and more (see docs).
{mask} can contain any of the macros and operators below.
Macros: Operators:
$bd space on drive d { } = @ & !
$d file drive greater less equal or and not
$e extension
$f filename
$n basename
$p file path
$s file size
$t file time
$y file date
$[ ] left justify macros between [ ]
$r ] right justify macros between r ]
$c ] center macros between c ]
$$ $
$, < \
$. > }these must be used to delay DOS redirection
$\ | /
Some details:
The entire list of files matching filespecs is loaded before any execution
takes place. This is done to prevent looping, and may change in future
versions.
To use DOS redirection within {command} you must use the $, $. and $\ macros.
Multiple filespecs can be included in {filespec} by separating them with commas.
The disk space macro ($b) can accept the file drive macro ($d) as a parameter.
The justification macros ($[ $r $c) pack as many spaces in as there are
characters between the macro and the terminator (exclusive). The space
between can contain other macros, EXCEPT other justification macros.
The comparason operators treat dates specially so that they will be handled
properly.
Pressing <ESC> during exeution will result in REPEAT pausing when it regains
control, at which time you can decide to abort REPEAT or continue.
Nothing in REPEAT is case sensitive.
Examples:
repeat echo $[$f ] $r$s ] $y $t for *.* if $y=10-11-1990
Produces a DOS-like directory of all files with date 10-11-1990.
repeat copy $f a:\ for *.* if $ba}$s
Copies files from current directory to drive a as long as there is space
for them. Note that the disk space check is done dynamically, so that
as each file is copied onto drive a, the space available is adjusted
accordingly.
repeat del $n.bas for *.obj
Deletes .BAS files with same basename as existing .OBJ files.
Suggestions, donations, feedback, or just plain comments can be addressed to:
InterNet: ben.bernard@channel1.com
SnailMail: Ben Bernard
POB 366
Celeste, TX 75423-0366